Skip to content

feat: Allow OpenQASM strings in CircuitBinding#1274

Open
speller26 wants to merge 11 commits into
mainfrom
openqasm-circuitbinding
Open

feat: Allow OpenQASM strings in CircuitBinding#1274
speller26 wants to merge 11 commits into
mainfrom
openqasm-circuitbinding

Conversation

@speller26

@speller26 speller26 commented Jun 3, 2026

Copy link
Copy Markdown
Member

This will allow customers to run program sets with programs using advanced OpenQASM features like dynamic circuits.

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This will allow users to run program sets with programs using advanced OpenQASM features like dynamic circuits.
@speller26 speller26 requested a review from a team as a code owner June 3, 2026 22:33
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (34ec586) to head (d7b16ec).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1274   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          171       171           
  Lines        11401     11489   +88     
  Branches      1480      1499   +19     
=========================================
+ Hits         11401     11489   +88     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/braket/program_sets/circuit_binding.py Outdated
Comment thread src/braket/program_sets/circuit_binding.py Outdated
Comment thread src/braket/program_sets/circuit_binding.py
if isinstance(stmt, QubitDeclaration) and register_name is None:
register_name = stmt.qubit.name
# stmt.size is None for a single unindexed qubit
register_size = stmt.size.value if isinstance(stmt.size, IntegerLiteral) else 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this handle more than one register?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we actually support multiple registers yet, so this is something I left as future work.

Comment thread src/braket/program_sets/circuit_binding.py Outdated
Comment thread tox.ini
@@ -17,7 +17,7 @@ extras = test
deps =
{[test-deps]deps}
commands =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this matter?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local testing wasn't producing test coverage, and this fixes that.

assert parsed.qubits == QubitSet([0])


def test_string_circuit_broadcast_gate():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about no operations?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test

Comment thread src/braket/program_sets/circuit_binding.py Outdated
Comment thread src/braket/program_sets/circuit_binding.py
Comment thread src/braket/program_sets/circuit_binding.py
Comment thread tox.ini
Comment thread src/braket/program_sets/circuit_binding.py Outdated
@speller26 speller26 requested review from rmshaffer and sesmart July 8, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants